package nowcoder.huawei;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Scanner;

/**
 * @author wuguojian
 * @description
 * @date 2023/4/12 下午9:46
 * https://www.nowcoder.com/practice/440f16e490a0404786865e99c6ad91c9
 **/
public class HJ15 {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner(new FileReader("input/nowcoder_huawei/HJ15.txt"));
//        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int a = in.nextInt();
            int count = 0;
            for(int i=0; i < 32; i++){
                //如果末位为1则计数
                if((a&1) == 1) {
                    count++;
                }
                a = a >>> 1;
            }
//            String s = Integer.toBinaryString(a);
//            char[] chars = s.toCharArray();
//            for (int i = 0; i < chars.length; i++) {
//                if(chars[i] == '1'){
//                    count++;
//                }
//            }
            System.out.println(count);
        }
    }
}
